i) Technical Field of the Invention
This invention relates to an electronic apparatus connectable to a network, and a system and method for deciding the address of the electronic apparatus.
ii) Description of the Related Art
Heretofore, several methods have been introduced for assigning an electronic apparatus an address for communicating with other apparatuses in a network. For example, the electronic apparatus may be assigned a predetermined static address manually, or it may obtain an address automatically from a Dynamic Host Configuration protocol (DHCP) server when the TCP/IP protocol is installed. Automatic Private IP Addressing (APIPA) which enables an electronic apparatus to automatically assign itself an IP address is also well-known.
APIPA is now becoming a standard feature of an operating system installed in a personal computer, etc. The electronic apparatus having the APIPA feature selects an IP address in a range of addresses from 169.254.1.0-169.254.255.255 within an IP address range (169.254.0.0-169.254.255.255) called linklocal address. Then, it uses Address Resolution Protocol (ARP) to ensure that the chosen address is not already being used by another electronic apparatus. Once the electronic apparatus is ensured that the chosen address is not in use, it assigns itself the chosen address. APIPA is also called AutoIP.
FIG. 4 illustrates an example of this APIPA process. Firstly, an IP address is selected randomly. In FIG. 4, an address 169.254.123.98 is selected. Then, an ARP request is sent to see whether there is an electronic apparatus which is assigned the IP address 169.254.123.98. If a reply to the ARP request is received from the address 169.254.123.98, it is determined that the chosen address 169.254.123.98 is already in use, and another IP address is selected randomly again. In FIG. 4, an address 169.254.78.22 is selected. An ARP request for the address is sent to ensure that the address is not already being used by another apparatus. There is no reply this time, and it is thus determined that there is no apparatus which is assigned the chosen IP address. The ARP request is sent once again by way of precaution. If no reply is received, the chosen IP address (169.254.78.22 in FIG. 4) is assigned to the electronic apparatus.
An electronic apparatus which is not adapted to APIPA generally has a fixed IP address, and the fixed IP address is not necessarily a linklocal address. Therefore, if the IP address of an electronic apparatus is automatically assigned by APIPA in a network where there are many conventional electronic apparatuses which are not adapted to APIPA (for example, apparatuses with the address 11.22.33.* ), those conventional electronic apparatuses are unable to access the apparatus using TCP/IP protocol.
In addition, if such an APIPA feature is added to a conventional electronic apparatus, there may be a case in which other apparatuses are unable to specify the address assigned by the electronic apparatus itself and consequently, the other apparatuses are unable to communicate with this electronic apparatus.
For instance, a printer connectable to a network is generally given a predetermined default IP address (for example, 192.0.0.192) before shipped. Management software installed in a personal computer communicates with the printer by the default IP address, and assigns a new IP address to the printer which is appropriate in the network.
However, if the APIPA feature is added to the printer, the printer automatically assigns itself an IP address in a range from 169.254.1.0-169.254.254.255 at random. Therefore, other apparatuses are unable to communicate with the printer by the default IP address, and the management software cannot access the printer unless it is informed of the IP address assigned by APIPA. In this case, the user has to directly operate the printer to modify the settings and control the printer by means of an operation panel thereof, for example. This is time-consuming.
As above, the conventional apparatus comprising the APIPA feature automatically assigns itself an IP address even if it should not do so, and thus, problems may occur when other apparatuses intend to communicate with the apparatus.
In addition, automatic address decision by APIPA is performed at the time an apparatus is started. The apparatus comprising the APIPA feature selects an IP address randomly in the above explained manner every time the apparatus is started. As a result, the IP address is changed every time the apparatus is started. Since there is an apparatus which communicates with other apparatuses with direct addressing, it is not preferable that the IP address of an apparatus is frequently changed. If the IP address of an apparatus is frequently changed, a conventional network apparatus which keeps the IP addresses of the other apparatuses as fixed addresses for communication over TCP/IP can no longer communicate with the other apparatuses.
Furthermore, the more apparatuses are in the network, the higher the ratio of the chosen IP address being already in use becomes. As a result, traffic in the network becomes heavy due to the excess ARP requests and replies.
In order to prevent an IP address from being changed at the time of restoration of an apparatus, the address assigned by APIPA is stored in a nonvolatile storage of the apparatus and selected as the first possible IP address of the apparatus. If every apparatus in the network performs such a process, the address of the apparatus will be fixed to a certain address as the apparatus is used in a long term. Accordingly, communication with the apparatus by direct addressing becomes possible and extra communications in the network exchanged to decide an address of the apparatus are avoided.
However, even if the address stored in the nonvolatile storage is sent as an ARP request, another IP address has to be selected again in case that there is a reply, that is, the address which has been used by the apparatus is already being used by another apparatus.
In this respect, there may be a case in which the address change is not desirable. For example, while a printer which has been using an address A for a long time in a network is turned off, a new personal computer becomes a member of the network and assigns itself the address A. When the printer is powered on, since the address A is already being used by the personal computer, the printer has to assign itself a new address B. As a result, the apparatuses in the network which have been transmitting print data to the address A fail to print the print data.
To prevent the above problem from happening, a fixed IP address may be assigned to the apparatuses adapted to APIPA in the same manner as in the conventional network apparatuses. Then, it is necessary to find an efficient way to find the apparatuses adapted to APIPA.